package com.example.demo.web.util;

import javax.annotation.PostConstruct;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class rabbitSender {
	@Autowired
    RabbitTemplate rabbitTemplate;
	
	public static rabbitSender rabbitsender;
    
    @PostConstruct
    public void init() {    
    	rabbitsender = this;
    }
	
	public void msend(String exchange,String topic, com.fasterxml.jackson.databind.JsonNode message) {
		rabbitTemplate.convertAndSend (exchange,topic, message);
	}
}
